<template>
  <div>
    <!-- 导航栏 -->
    <pc-nav />
    <!-- 菜单栏 -->
    <pc-header />
    <!-- 内容 -->
    <div class="container">
      <router-view />
    </div>
    <Login @register="register" @forgetFun="forgetFun" v-if="isLogin=='show'" />
    <Forget @forgetFun="forgetf" v-if="isForget" />
    <Register @loginFun="loginFun" v-if="isRegister" />
    <CookiesWarp @saveCookies2="saveCookies2" @closeFun="closeFun" v-if="saveCookies=='show'" />
  </div>
</template>

<script>
import pcNav from "componentsPath/common/pc/nav";
import pcHeader from "componentsPath/common/pc/header";
import api from "servicePath/index";
import Login from "componentsPath/login/index";
import Register from "componentsPath/register/index";
import Forget from "componentsPath/forget/index";
import CookiesWarp from "componentsPath/cookiesWrap/pc/index";
import { mapState, mapMutations } from "vuex";
export default {
  components: {
    pcNav,
    pcHeader,
    Login,
    Register,
    Forget,
    CookiesWarp
  },
  data() {
    return {
      isRegister: false,
      isForget: false
    };
  },
  computed: {
    ...mapState(["isLogin", "saveCookies"])
  },
  mounted() {},
  methods: {
    ...mapMutations(["saveCookie"]),
    register() {
      this.isRegister = true;
    },
    loginFun() {
      this.isRegister = false;
    },
    forgetFun() {
      this.isForget = true;
    },
    saveCookies2() {
      this.saveCookie("hide");
      localStorage.setItem("saveCookies", "hide");
      console.log(this.saveCookies);
    },
    closeFun() {
      this.saveCookie("hide");
    },
    forgetf(){
      this.isForget=false;
    }
  }
};
</script>

<style lang="scss" scoped></style>
